﻿//https://ac.nowcoder.com/acm/problem/205350
#include <iostream>
#include <cmath>
using namespace std;
typedef long long LL;
int main()
{
	LL x;
	cin >> x;
	LL a = sqrt(x);
	LL x1 = a * a, x2 = (a + 1) * (a + 1);
	if (x - x1 < x2 - x) cout << x1 << endl;
	else cout << x2 << endl;
	return 0;
}

//https://ac.nowcoder.com/acm/problem/229023

#include <iostream>
#include <unordered_map>
using namespace std;
int n, m;
unordered_map<int, int> cnt; // 统计每种声部的⼈数
bool check(int x) // 判断最多⼈数为 x 时，能否分成 m 组
{
	int g = 0; // 能分成多少组
	for (auto& [a, b] : cnt)
	{
		g += b / x + (b % x == 0 ? 0 : 1);
	}
	return g <= m;
}
int main()
{
	cin >> n >> m;
	int hmax = 0; // 统计声部最多的⼈数
	for (int i = 0; i < n; i++)
	{
		int x;
		cin >> x;
		hmax = max(hmax, ++cnt[x]);
	}
	int kinds = cnt.size();
	if (kinds > m) // 处理边界情况
	{
		cout << -1 << endl;
	}
	else
	{
		// // 暴⼒枚举
		// for(int i = 1; i <= hmax; i++) // 枚举所有的最多⼈数
		// {
		// if(check(i))
		//   {
		// cout << i << endl;
			// break;
			// }
				// }
		// ⼆分解法
		int l = 1, r = hmax;
		while (l < r)
		{
			int mid = (l + r) / 2;
			if (check(mid)) r = mid;
			else l = mid + 1;
		}
		cout << l << endl;
	}
	return 0;
}

//https://www.nowcoder.com/practice/88f7e156ca7d43a1a535f619cd3f495c?tpId=308&tqId=40470&ru=/exam/oj
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
const int N = 2e5 + 10;
vector<vector<int>> edges(N); // edges[i] 表⽰ i 这个点所连接的边的信息
int in[N]; // 统计⼊度信息
int n, m;
queue<int> q;
vector<int> ret; // 记录最终结果
int main()
{
	cin >> n >> m;
	while (m--)
	{
		int a, b;
		cin >> a >> b;
		edges[a].push_back(b); // 存储边的信息
		in[b]++; // 存储⼊度
	}
	for (int i = 1; i <= n; i++) // 把⼊度为 0 的点放进队列中
	{
		if (in[i] == 0)
		{
			q.push(i);
		}
	}
	while (q.size())
	{
		int a = q.front();
		q.pop();
		ret.push_back(a);
		for (auto b : edges[a])
		{
			if (--in[b] == 0)
			{
				q.push(b);
			}
		}
	}
	// 判断
	if (ret.size() == n)
	{
		for (int i = 0; i < n - 1; i++)
		{
			cout << ret[i] << " ";
		}
		cout << ret[n - 1]; // 测评会考虑最后⼀个元素的空格
	}
	else
	{
		cout << -1 << endl;
	}
	return 0;
}